def reverseContent(enstr:str)->str:
    chs=lambda x :bytes(range(x,x+26)).decode()
    l=chs(0x41)+chs(0x61) #字母表
    #将单词和标点符号分割出来，存入到列表中
    Seqlist=[]
    #是否存在连续的单词字符
    bexist=None
    sIndex=0
    for k,s in enumerate(enstr):
        if bexist is None:
            bexist=s in l
        #考虑到连词的问题，比如： President-elect  
        if bexist and s not in l and s != "-":
                bexist=False
                Seqlist.append((True,enstr[sIndex:k]))
                sIndex=k   
        elif not bexist and s in l:
                bexist=True
                Seqlist.append((False,enstr[sIndex:k]))
                sIndex=k
    if sIndex <= len(enstr):
        Seqlist.append((bexist,enstr[sIndex:]))
      
    #只翻转单词但标点及其他字符不变
    #记录单词索引，并翻转                  
    NormalOrderList = [s[1] for s in Seqlist]
    ReverseOrderList= NormalOrderList[:]
    #提取正常的单词索引顺序
    NormalOrder=[k for k,v in enumerate(Seqlist) if v[0]]
    #翻转单词索引顺序
    reversedOrder= reversed(NormalOrder)

    for n,r in zip(NormalOrder,reversedOrder):
        ReverseOrderList[n]=NormalOrderList[r]
    
                        
    return "".join(ReverseOrderList)


content='President-elect Donald Trump says he will continue to use Twitter when he takes office, but that he will be "very restrained" while in the White House.'
reverseContent(content)
        
# 翻转内容实现了，但是没有考虑到换行符以及部分标点符号的情况。